package be.aquafin.klipdf.handlers;

import java.util.List;

import be.aquafin.klipdf.dao.DataDao;
import be.aquafin.klipdf.model.DataObject;
import be.aquafin.klipdf.model.Node;
import be.aquafin.klipdf.model.json.JSONObject;

public final class NodeHandler extends DataHandler {

	public NodeHandler(DataDao dataDao) {
		super(dataDao);
	}

	@Override
	protected List<? extends DataObject> getData(List<String> keys) {
		return dataDao.getNodes(keys);
	}

	@Override
	protected JSONObject process(DataObject dataObject) {
		Node node = (Node) dataObject;
		JSONObject nodeJsonObject = new JSONObject();
		// put every field into a JSON key/value entry
		nodeJsonObject.put("uid", node.getUid());
		// ...

		return nodeJsonObject;
	}

}
